home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / shelp50a.zip / HELPLIB.PRG < prev    next >
Text File  |  1991-08-11  |  8KB  |  225 lines

  1.  
  2. FUNCTION DSPHELP
  3.   SETHELP()
  4.   SCROLLHLP()
  5. RETURN NIL
  6.  
  7.  
  8. FUNCTION SETHELP
  9. IF ISCOLOR()
  10.    SETCOLOR(cWinColor)
  11. ELSE
  12.    SETCOLOR("N/W")
  13. ENDIF
  14. * SADJPOS() will automatically correct windows that were created for 43+ Line
  15. * mode but is running in 25 line mode
  16. * When Auto Ajusting Window - (.T.) Displays Msg / (.F.) No Msg Displayed
  17. SADJPOS(.F.)
  18. ************************************************************************
  19. * All SPECIAL EFFECTS may be called by your programs & functions
  20. * Syntax for all boxes are as follows
  21. *   nTopRow     - Top Row
  22. *   nLeftCol    - Left Column
  23. *   nBotRow     - Bottom Row
  24. *   nRightCol   - Right Column
  25. *   cFrame     - Frame Style
  26. *   lIplode     - Logical to Implode box on Exit
  27. *   cFramColor - Color String of Frame
  28. *   cWinColor   - Color String of Window
  29. *   cShadType   - "R" or "S" for Shadow Position
  30. *   TranShad   - Logical to Make Transparent Shadow or Regular Shadow
  31. *   nShadClrf   - Numeric Foreground Shadow Color (Transparent Only)
  32. *   nShadClrb   - Numeric Background Shadow Color (Transparent Only)
  33. * Important *
  34. *   To implode a box, you must first create one of the SPECIAL EFFECTS
  35. *   boxes with the lIplode switch as a logical True.  The Implode Box
  36. *   must be called separately with the Return Value.
  37. ************************************************************************
  38. DO CASE
  39. CASE nBoxMethod == 1
  40.    @ nTopRow,nLeftCol CLEAR TO nBotRow,nRightCol
  41.    SETCOLOR(cFramColor)
  42.    @ nTopRow,nLeftCol,nBotRow,nRightCol BOX cFrame
  43.    SShadows(nTopRow,nLeftCol,nBotRow,nRightCol,cShadType,.T.,nShadclrf,nShadclrb)
  44. CASE nBoxMethod == 2
  45.    nNoFrames:=SXPLODEBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  46. CASE nBoxMethod == 3
  47.    nNoFrames:=SDROPBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  48. CASE nBoxMethod == 4
  49.    nNoFrames:=SPOPBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  50. CASE nBoxMethod == 5
  51.    nNoFrames:=SUPDWBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  52. CASE nBoxMethod == 6
  53.    nNoFrames:=SCURTBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  54. CASE nBoxMethod == 7
  55.    nNoFrames:=SLEFTBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  56. CASE nBoxMethod == 8
  57.    nNoFrames:=SRIGHTBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  58. OTHERWISE
  59.    nNoFrames:=SXPLODEBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
  60. ENDCASE
  61. SETCOLOR(cFramColor)
  62. DO CASE
  63.    CASE nWinType == 1
  64.       @nTopRow,nHeadcol-1 SAY SUBSTR(cMidBar,2,1)
  65.       @nTopRow,nHeadcol+LEN(TRIM(cHeader)) SAY SUBSTR(cMidBar,1,1)
  66.    CASE nWinType == 2
  67.       @nTopRow+2,nLeftCol SAY REPLICATE(SUBSTR(cFrame,2,1),nRightCol-nLeftCol)
  68.       @nTopRow+2,nLeftCol SAY SUBSTR(cMidBar,1,1)
  69.       @nTopRow+2,nRightCol SAY SUBSTR(cMidBar,2,1)
  70. ENDCASE
  71. DO CASE
  72.    CASE nFootType == 1
  73.       @nBotRow,nFootcol-1 SAY SUBSTR(cMidBar,2,1)
  74.       @nBotRow,nFootcol+LEN(TRIM(cFooter)) SAY SUBSTR(cMidBar,1,1)
  75.    CASE nFootType == 2
  76.       @nBotRow-2,nLeftCol SAY REPLICATE(SUBSTR(cFrame,2,1),nRightCol-nLeftCol)
  77.       @nBotRow-2,nLeftCol SAY SUBSTR(cMidBar,1,1)
  78.       @nBotRow-2,nRightCol SAY SUBSTR(cMidBar,2,1)
  79. ENDCASE
  80. SETCOLOR(cWinColor)
  81. IF lEditRef
  82.    @ MaxRow(),0 SAY SPACE(MaxCol())
  83.    IF lEditRef
  84.      @ MaxRow(),(MaxCol()/2)-8 SAY 'F5 - Modify Help'
  85.    ENDIF
  86. ENDIF
  87.  
  88. IF !EMPTY(cHeader)
  89.   SETCOLOR(cHeadColor)
  90.   IF nWinType == 1
  91.     @ nTopRow, nHeadcol SAY TRIM(cHeader)
  92.   ELSE
  93.     cTrimHdr := TRIM(cHeader)
  94.     @ nTopRow+1, nLeftCol+1 SAY SPACE(nHeadcol-nLeftCol)+cTrimHdr+SPACE((nRightCol-1-nHeadcol)-LEN(cTrimHdr))
  95.   ENDIF
  96. ENDIF
  97. IF !EMPTY(cFooter)
  98.   SETCOLOR(cFootColor)
  99.   IF nFootType == 1
  100.     @ nBotRow, nFootcol SAY TRIM(cFooter)
  101.   ELSE
  102.     cTrimFoot := TRIM(cFooter)
  103.     @ nBotRow-1, nLeftCol+1 SAY SPACE(nFootcol-nLeftCol)+cTrimFoot+SPACE((nRightCol-1-nFootcol)-LEN(cTrimFoot))
  104.   ENDIF
  105.   SETCOLOR(cWinColor)
  106. ENDIF
  107. RETURN NIL
  108.  
  109.  
  110. FUNCTION SCROLLHLP
  111. PRIVATE nBarTop,nBarBot,cBarChar,nPrevBar
  112. SET CURSOR OFF
  113. cBarChar := "░"
  114. lOutLoop := .T.
  115. nText_Cnt := 0
  116. cSetUdf := 'P'
  117. SUDFPBAR()
  118. DO WHILE lOutLoop
  119.    SCROLLUDF()
  120.    DO WHILE .T.
  121.      INKEY(0)
  122.       DO CASE
  123.       CASE LASTKEY() == 5 .AND. !lTopPage
  124.           SDYNALINE(-1*nMWidth)
  125.           cSetUdf := 'U'
  126.           EXIT
  127.       CASE LASTKEY() == 24 .AND. !lBotPage 
  128.           SDYNALINE(nMWidth)
  129.           cSetUdf := 'D'
  130.           EXIT
  131.          CASE LASTKEY() == 18 .AND. !lTopPage
  132.             SDYNAPAGE(-1*(nReadSize))
  133.             cSetUdf := 'P'
  134.             lBotPage := .F.
  135.             EXIT
  136.          CASE LASTKEY() == 3 .AND. !lBotPage
  137.             SDYNAPAGE(nReadSize)
  138.             cSetUdf := 'P'
  139.             lTopPage := .F.
  140.             EXIT
  141.          CASE LASTKEY() == -4 .AND. lEditRef
  142.             SUDFMENU()
  143.             SETHELP()
  144.             SUDFPBAR()
  145.             EXIT
  146.          CASE LASTKEY() == 27
  147.             lOutLoop := .F.
  148.             EXIT
  149.       ENDCASE
  150.    ENDDO
  151. ENDDO
  152. SET CURSOR ON
  153. IF nBoxMethod > 1 .and. lIplode
  154.    IPLODEBX(nNoFrames)
  155.    RELEASE aIplodeScr
  156. ENDIF
  157. RETURN NIL
  158.  
  159.  
  160. FUNCTION SUDFPBAR
  161. nPrevBar := 0
  162. nBarTop := IIF(nWinType==1,nTopRow+2,nTopRow+3)
  163. nBarBot := IIF(nFootType==1,nBotRow-2,nBotRow-3)
  164. SETCOLOR('W+/N')
  165. FOR nBarcnt := nBarTop TO nBarBot
  166.    @ nBarcnt, nRightCol SAY cBarChar
  167. NEXT
  168. SETCOLOR(cWinColor)
  169. RETURN NIL
  170.  
  171.  
  172.  
  173. FUNCTION SCROLLUDF
  174. LOCAL nCurLine,nScrnSize,nStartRow,nBarLines,nBarPct,nBarPos,cHeadBar,cFootBar
  175.    cHeadBar := IIF(nWinType==1,SUBSTR(cFrame,8,1),SUBSTR(cMidBar,2,1))
  176.    cFootBar := IIF(nFootType==1,SUBSTR(cFrame,8,1),SUBSTR(cMidBar,2,1))
  177.    nScrnSize := (nBotRow-IIF(nFootType==1,0,2)) - (nTopRow+IIF(nWinType==1,1,3))
  178.    nStartRow  := nTopRow+IIF(nWinType==1,1,3)
  179.    nText_Cnt := 0
  180.    nLines := 0
  181.    DO CASE
  182.    CASE cSetUdf == 'P'
  183.    @ nTopRow+IIF(nWinType==1,1,3),nLeftCol+1 CLEAR TO nBotRow-IIF(nFootType==1,1,3),nRightCol-1
  184.    FOR nCurLine := nStartRow TO nStartRow+nScrnSize
  185.     IF nText_Cnt < nLineSize
  186.       nText_Cnt := nText_Cnt + 1
  187.       nLines := nLines + 1
  188.       IF lXplodeTxt 
  189.          XPLODEHLP(aHelpLine[nText_Cnt],nCurLine,(nLeftCol+((nRightCol-nLeftCol)/2))+nHlpSpacer)
  190.       ELSE
  191.          @ nCurLine,nLeftCol+1 SAY aHelpLine[nText_Cnt]
  192.       ENDIF
  193.     ENDIF
  194.    NEXT
  195.  CASE cSetUdf == 'U'
  196.    SCROLL(nTopRow+IIF(nWinType==1,1,3),nLeftCol+1,nBotRow-IIF(nFootType==1,1,3),nRightCol-1,-1)
  197.    @ nTopRow+IIF(nWinType==1,1,3),nLeftCol+1 SAY aHelpLine[1]
  198.  CASE cSetUdf == 'D'
  199.    SCROLL(nTopRow+IIF(nWinType==1,1,3),nLeftCol+1,nBotRow-IIF(nFootType==1,1,3),nRightCol-1,1)
  200.    @ nBotRow-IIF(nFootType==1,1,3),nLeftCol+1 SAY aHelpLine[1]
  201. ENDCASE
  202. nBarlines := nBarBot-nBarTop
  203. nBarPct := nByteRead/nTxtSize
  204. nBarPos := nBarTop+ROUND(nBarLines*nBarPct,1)
  205. SETCOLOR('W+/N')
  206. IF nPrevBar > 0
  207.    @ nPrevBar, nRightCol SAY cBarChar
  208. ENDIF
  209. @ IIF(lTopPage,nBarTop,IIF(lBotPage,nBarBot,nBarPos)), nRightCol SAY '▓'
  210. nPrevBar := IIF(lTopPage,nBarTop,IIF(lBotPage,nBarBot,nBarPos))
  211. IF !lBotPage
  212.    @ nBotRow-2,nRightCol SAY CHR(25)
  213. ELSE
  214.    SETCOLOR(cFramColor)
  215.    @ nBotRow-2,nRightCol SAY cFootBar
  216. ENDIF
  217. SETCOLOR('W+/N')
  218. IF !lTopPage
  219.    @ nTopRow+2,nRightCol SAY CHR(24)
  220. ELSE
  221.    SETCOLOR(cFramColor)
  222.    @ nTopRow+2,nRightCol SAY cHeadBar
  223. ENDIF
  224. SETCOLOR(cWinColor)
  225. RETURN NIL